package cloudPayAdmin.admin.dbapp.repo.hicatcard.user;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import cloudPayAdmin.admin.dbapp.entity.hicatcard.user.TUserThird;

public interface UserThirdRepo extends JpaRepository<TUserThird, Long>, JpaSpecificationExecutor<TUserThird> {
	
	@Query("select max(SUBSTRING(t.accountId, 4)) from TUserThird t where t.enable = true")
	public String getMaxAccountId();
	
	@Query("select max(t.batch) from TUserThird t where t.enable = true")
	public Integer getMaxBatch();
	
	@Query("select t from TUserThird t where t.accountId in ?1 and t.enable = true")
	public List<TUserThird> findByAccountIds(List<String> accountIds);
}
